package com.gable.exhibition.thread;

import com.gable.exhibition.util.HttpHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by mj on 2018/2/1.
 * 维修结束解散群组
 */
public class EndChatGroupThread implements Runnable{

    Logger logger = LoggerFactory.getLogger(EndChatGroupThread.class);

    private String fromId;

    private String fromType;

    private String webSocket_endChatGroupUrl;

    public EndChatGroupThread(String fromId,String fromType,String webSocket_endChatGroupUrl){
        this.fromId = fromId;
        this.fromType = fromType;
        this.webSocket_endChatGroupUrl = webSocket_endChatGroupUrl;
    }
    @Override
    public void run() {
        String result = "";
        try {
            Map<String,String> map = new HashMap<String,String>();
            map.put("fromId",fromId);
            map.put("fromType",fromType);
            result = HttpHelper.postRequestResponseBodyAsString(webSocket_endChatGroupUrl, map);
        } catch (Exception e) {
            logger.error("解散群组失败："+e);
        }
        logger.info(result);
    }
}
